home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / AppleTalk Wide Area / XTI Shell Sample Code / Shell includes / XTIShell.h < prev   
Encoding:
C/C++ Source or Header  |  1993-02-15  |  6.4 KB  |  222 lines  |  [TEXT/MPS ]

  1. /*_________________________________________________________________________________
  2.  
  3.     File:        XTIShell.h
  4.     
  5.     Apple Computer, Inc. 
  6.     Copyright (C) 1992,1993.  All rights reserved.
  7.     
  8.     This file contains the includes for the XTI Shell 
  9.         
  10.     Revision History:
  11.     
  12. __________________________________________________________________________________*/
  13.  
  14.  
  15. #ifndef    _SHELL_H_
  16. #define    _SHELL_H_
  17.  
  18. #include    <QuickDraw.h>
  19. #include    <Controls.h>
  20. #include    <TextEdit.h>
  21. #include    <Memory.h>
  22. #include    <OSUtils.h>
  23. #include    <ToolUtils.h>
  24. #include    <Resources.h>
  25. #include    <Lists.h>
  26. #include    <TextEdit.h>
  27. #include    <Fonts.h>
  28. #include    <Values.h>
  29. #include    <Windows.h>
  30. #include    <Packages.h>
  31. #include    <String.h>
  32. #include    <Strings.h>
  33. #include    <Dialogs.h>
  34. #include    <RomDefs.h>
  35. #include    <Slots.h>
  36. #include    <Scrap.h>
  37. #include    <Menus.h>
  38. #include    <Devices.h>
  39. #include    <StdLib.h>
  40. #include    <SysEqu.h>
  41. #include    <Folders.h>
  42. #include    <Palettes.h>
  43. #include    <QDOffScreen.h>
  44. #include    <Files.h>
  45. #include    <Errors.h>
  46. #include    <Types.h>
  47. #include    <Timer.h>
  48. #include    <AppleTalk.h>
  49. #include    "XTIShell_r.h"
  50. #include    "X25_Addr.h"
  51. #include    "XTI.h"
  52. #include    "TAdev.h"
  53.  
  54.  
  55. /********************************************/
  56. /* defines for log messages                    */
  57. /********************************************/
  58.  
  59. #define        kMaxLogStrLen            60
  60. #define        kNumLogStr                6
  61.  
  62. #define        kDialLog                1        
  63. #define        kAnswerLog                2
  64. #define        kConnectLog                3
  65. #define        kConnDownLog            4
  66. #define        kConnClearLog            5
  67. #define        kConnReqFailLog            6        
  68. #define        kPasswordLog            7
  69.  
  70. /****************************************************************/
  71. /* ReOpenTMRec used for time manager                            */
  72. /****************************************************************/
  73.  
  74. typedef struct ReOpenTMRec {
  75.     TMTask                    tmInfo;
  76. };
  77.  
  78.  
  79. #ifndef __cplusplus
  80. typedef struct ReOpenTMRec ReOpenTMRec;
  81. #endif
  82.  
  83. typedef struct ReOpenTMRec* ReOpenTMRecPtr;
  84.  
  85. /****************************************************************/
  86. /* dtRec used for deferred task manager                            */
  87. /****************************************************************/
  88.  
  89. typedef struct dtRec {
  90.     QElemPtr                qLink;            
  91.     short                     qType;
  92.      short                     dtFlags;
  93.     ProcPtr                    dtAddr;
  94.     long                    dtParm;
  95.     long                    dtReserved;
  96. };
  97.  
  98.  
  99. #ifndef __cplusplus
  100. typedef struct dtRec dtRec;
  101. #endif
  102.  
  103. typedef struct dtRec* dtRecPtr;
  104.  
  105. /**********************************************/
  106. /* XTIacfg passed between interface and atlk  */
  107. /**********************************************/
  108.  
  109. #define kMaxPWLength        8
  110.  
  111. typedef struct XTIacfg {
  112.     Boolean         isCalling;      /* is the call/answer mode field        */
  113.     Boolean         autoReconn;     /* is the reconnect check box           */
  114.     char            password[kMaxPWLength+1];    /* password as pascal string            */
  115.     TTSAP            localAddr;        /* local address field                    */
  116.     TTSAP            remoteAddr;        /* remote address field                    */
  117. };
  118.  
  119. #ifndef __cplusplus
  120. typedef struct XTIacfg XTIacfg;
  121. #endif
  122.  
  123. typedef struct XTIacfg* XTIacfgPtr;
  124.  
  125. /****************************************/
  126. /* ADEV signature  Record                 */
  127. /****************************************/
  128. //
  129. // You may want to change this to contain your own link
  130. // specific information.  It is internal to the adev.
  131. //
  132.  
  133. typedef struct TADEVSigRec {
  134.     short        id;
  135.     char        port;
  136.     char        slot;
  137. };
  138.  
  139.  
  140. #ifndef __cplusplus
  141. typedef struct TADEVSigRec TADEVSigRec;
  142. #endif
  143.  
  144. typedef struct TADEVSigRec* TADEVSigRecPtr;
  145.  
  146.  
  147. /****************************************************************/
  148. /* CShellGlobals contains the globals used in the C routine        */
  149. /****************************************************************/
  150.  
  151. typedef struct CShellGlobals {
  152.     TMTask                    tmInfo;                /* this must be the first field to get         */
  153.     long                    myA5;                /* the address when using the time manager     */
  154.     Boolean                    bindComplete;        /* true if the bind has completed */
  155.     short                    bindErr;            /* the bind error */
  156.     Ptr                        logStr[kNumLogStr];    /* array of log strings */
  157.     ReOpenTMRecPtr            openTMRec;            /* time manager record for open */
  158.     dtRecPtr                mydtRec;            /* deferred task manager record */
  159.     XTIacfg                    theConfig;            /* the configuration record from Router Manager */
  160.     int                        fd;                    /* the endpoint file descriptor */
  161.     Boolean                    isConnected;        /* true if we are connected */
  162.     Boolean                    isFlowControlled;    /* true if we are flow controlled */
  163.     Boolean                    isSending;            /* true if we are sending */
  164.     Boolean                    waitMoreData;        /* true if there is no more data waiting to be read */
  165.     Boolean                    isReconnecting;        /* true if we are reconnecting */
  166.     Boolean                    toldConnDone;        /* true if we have already told AURP the connection is done */
  167.     short                    sendBuffLen;        /* the actual size of the buffer we are sending */
  168.     Ptr                        dataToSendPtr;        /* pointer to the sendBuff that we can manipulate freely */
  169.     Ptr                        sendBuffer;            /* the send buffer */
  170.     short                    rcvBuffLen;            /* the current length of the receive buffer */    
  171.     Ptr                        receiveBuffer;        /* the receive buffer */
  172.     Boolean                    waitForBind;        /* true if there is a bind outstanding */
  173. };
  174.  
  175.  
  176. #ifndef __cplusplus
  177. typedef struct CShellGlobals CShellGlobals;
  178. #endif
  179.  
  180. typedef struct CShellGlobals* CShellGlobalsPtr;
  181.  
  182. /********************************************/
  183. /* XTIShellVars must be same as in .a file    */
  184. /********************************************/
  185.  
  186. #define        kNextIR                 2    
  187.  
  188. typedef struct XTIShellVars {
  189.     CShellGlobalsPtr        cGlobals;        /* Ptr to variables used in C routine        */
  190.     short                    HopCntWght;        /* hop count weight                            */
  191.     char                    remoteAddr[16];    /* remote address as pascal string            */
  192.     long                    AURPWriteEntry;    /* AURP LAP write code entry point            */
  193.     long                    AURPRefNum;        /* AURP refnum                                */
  194.     long                    NextIRBlk;         /* next IR                                    */
  195.     long                    lineSpeed;         /* faked line speed to tell the router        */
  196.     ProcPtr                    AURPDispatch;    /* aurp dispatch routine                    */
  197.     short                    OurDI;            /* our domain identifier                    */
  198.     long                    otherNode;        /* domain identifier of other router        */
  199.     short                    maxRPktSz;        /* maximum packet size                        */
  200.     WDSElement*                wDSPtr;            /* WDSPtr for XTIWRITE                        */
  201.     Boolean                    rcvBufAvail    ;    /* set flag if receive buffer is available    */
  202.     char                    rcvPktsWaiting;    /* number of packets waiting to be read     */
  203.     char                    XTIFlags;        /* flags for this atlk                        */
  204.     char                    OurPortId;        /* Our port id                                */
  205.     char                    OurSlotId;        /* Our slot number                            */
  206. };
  207.  
  208. #ifndef __cplusplus
  209. typedef struct XTIShellVars XTIShellVars;
  210. #endif
  211.  
  212. typedef struct XTIShellVars* XTIShellVarsPtr;
  213.  
  214. /* ATLK calls imported from .a file */
  215. extern    Ptr        GETSYSMEM    (long    blockSize);
  216. extern    void    CONNDONE    (long    errResult);
  217. extern  long    GETMYA5        (void);
  218. extern  void    SETMYA5        (long  theA5);
  219.  
  220. extern  void    memcpySetLongMove (long);
  221.  
  222. #endif _SHELL_H_